
// ==================================================
// 	初始化绑定全局方法
// 	20180803
//	刘剑
//	563084506@qq.com
// ==================================================

global.under2Camel=(under)=>{//下划线转驼峰
	return under.toLowerCase().replace(/_([a-z])/g,($0,$1)=>{
		return $1.toUpperCase();
	});
}
global.under2Pascl=(under)=>{//下划线转驼峰
	return under.toLowerCase().replace(/_([a-z])/g,($0,$1)=>{
		return $1.toUpperCase();
	}).replace(/^[a-z]/,$0=>$0.toUpperCase());
}
global.camel2Pascl=(under)=>{//下划线转驼峰
	return under.replace(/^[a-z]/,$0=>$0.toUpperCase());
}

global.assert = (b,msg)=>{
	if(!b)
		throw msg;
}
/**
* 解决ejs对Windows系统下路径解析的问题
*/
global.extrucPath=function (p) {
	if(!p.startsWith('/'))return "/"+p;
	return p;
}
let jdbcType = require("./config/jdbcType");
global.toJdbcType = (b)=>{
	b=b.toUpperCase();
	b=jdbcType[b]?jdbcType[b]:b;
	return b;
}